export default{
  namespaced : true,
  
  state:()=>({
    token:uni.getStorageSync('token') || '',
    userInfo: JSON.parse(uni.getStorageSync('userInfo') || '{}' ),
    redirectInfo:null
  }),
  mutations:{
    
    /*信息存储化*/
    storageData(state){
      uni.setStorageSync("userInfo",JSON.stringify(state.userInfo))
      uni.setStorageSync('token', state.token)
    },
    
    /*获取 用户信息*/
    updateUserInfo(state,info){
      state.userInfo = info
      this.commit('my_user/storageData')
    },
    
    /*获取 token*/
    upToken(state,token){
      state.token = token
      this.commit('my_user/storageData')
    },
    
    /*接受返回参数*/
    upReInfo(state,reinfo){
      state.redirectInfo = reinfo
      this.commit('my_user/storageData')
    }
    
  },
  getters:{
    
  }
}